package com.zzy.customglide;

import android.app.Activity;
import android.content.Context;
import android.support.v4.app.FragmentActivity;

public class ZGlide {
    RequestManagerRetriver retriver;

    public ZGlide(RequestManagerRetriver requestManagerRetriver){
        this.retriver=requestManagerRetriver;
    }
    public static RequestManager with(FragmentActivity fragmentActivity){
        return getRetriver(fragmentActivity).get(fragmentActivity);
    }
    public static RequestManager with(Activity activity){
        return getRetriver(activity).get(activity);
    }
    public static RequestManager with(Context context){
        return getRetriver(context).get(context);
    }

    private static RequestManagerRetriver getRetriver(Context context) {
            return ZGlide.get(context).getRetriver();
    }
    public RequestManagerRetriver getRetriver(){
        return  retriver;
    }
    //
    public static ZGlide get(Context context){
        return new GlideBuilder().build();
    }
}
